package com.zfk.transaction.service.impl;

import com.zfk.transaction.entity.Product;
import com.zfk.transaction.mapper.GoodsListMapper;
import com.zfk.transaction.service.GoodsListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsListServiceImpl implements GoodsListService {

    @Autowired
    private GoodsListMapper goodsListMapper;
    @Override
    public List<Product> getByChannelId(int channel_id) {

        List<Product> list = goodsListMapper.getByChannelId(channel_id);

        return list;
    }

    @Override
    public Product getById(String product_id) {
        Product product = goodsListMapper.getById(product_id);
        return product;
    }

    @Override
    public List<Product> getByLikeName(String name) {
        List<Product> products = goodsListMapper.getByLikeName(name);

        return products;
    }

    @Override
    public List<Product> getByUserId(String user_id) {
        return goodsListMapper.getByUserId(user_id);
    }

    @Override
    public int deleteById(String product_id) {
        return goodsListMapper.deleteById(product_id);
    }

    @Override
    public int update(Product product) {
        return goodsListMapper.update(product);
    }
}
